package com.czg.designmode.factory.abstracts;

/**
 * 男人的衣柜里面的东西枚举类
 *
 * @author chenzhigang
 */

@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
public enum ManEnum {
    TROUSERS("trousers", "裤子", new ManTrousers()),
    SHOE("shoe", "鞋子", new ManShoe()),
    JACKET("jacket", "上衣", new ManJacket()),
    ;

    private String type;

    private String desc;

    private ManCloset manCloset;

    ManEnum() {
    }

    ManEnum(String type, String desc, ManCloset manCloset) {
        this.type = type;
        this.desc = desc;
        this.manCloset = manCloset;
    }

    /**
     * 根据衣柜里面的东西类型获取衣柜
     *
     * @param type 衣柜东西类型
     * @return 衣柜
     */
    public static ManCloset getClosetByType(String type) {
        for (ManEnum manEnum : ManEnum.values()) {
            if (manEnum.getType().equals(type)) {
                return manEnum.getManCloset();
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public ManCloset getManCloset() {
        return manCloset;
    }

    public void setManCloset(ManCloset manCloset) {
        this.manCloset = manCloset;
    }
}
